{{ $params      := .Site.Params }}
{{ $logo        := $params.logos.hero }}
{{ $description := $params.description | markdownify }}
{{ $social      := $params.social }}
{{ $github      := $social.github }}
{{ $latest      := site.Params.versions.latest }}
{{ $hasPosts    := gt (len (where site.RegularPages "Section" "blog")) 0 }}
<section class="hero is-medium is-primary">
  <div class="container has-text-centered">
    <div class="hero-body">
      <img class="is-hero-logo" src="{{ $logo }}" alt="etcd main hero logo">

      <p class="subtitle is-size-2 is-size-4-mobile has-text-white-bis has-text-weight-light">
        {{ $description }}
      </p>

      <br />

      <div class="buttons is-centered">
        <a class="button is-primary is-inverted is-large is-radiusless" href="/docs/v{{ $latest }}">
          <span class="icon">
            <i class="fas fa-info"></i>
          </span>
          <span class="has-text-weight-bold">
            Docs
          </span>
        </a>

        {{ if $hasPosts }}
        <a class="button is-danger is-inverted is-medium is-radiusless" href="/blog">
          <span class="icon">
            <i class="fas fa-rss"></i>
          </span>
          <span class="has-text-weight-bold">
            Blog
          </span>
        </a>
        {{ end }}

        <a class="button is-black is-medium is-radiusless" href="{{ $github }}" target="_blank">
          <span class="icon">
            <i class="fab fa-github"></i>
          </span>
          <span class="has-text-weight-bold">
            GitHub
          </span>
        </a>
      </div>
    </div>
  </div>
</section>
